#include "Material.h"

Material::Material()
{
	m_Shininess = 0.0f;	
}

GLvoid Material::SetAmbient(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
{
	mat_Ambient[0] = r;
	mat_Ambient[1] = g;
	mat_Ambient[2] = b;
	mat_Ambient[3] = a;
}

GLvoid Material::SetDiffuse(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
{
	mat_Diffuse[0] = r;
	mat_Diffuse[1] = g;
	mat_Diffuse[2] = b;
	mat_Diffuse[3] = a; 
}

GLvoid Material::SetSpecular(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
{
	mat_Specular[0] = r;
	mat_Specular[1] = g;
	mat_Specular[2] = b;
	mat_Specular[3] = a; 
}

GLvoid Material::SetShininess(GLfloat ShineLevel)
{
	m_Shininess = ShineLevel;
}

void Material::Use()
{
	glMaterialfv(GL_FRONT, GL_AMBIENT, mat_Ambient);
	glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_Diffuse);
	glMaterialfv(GL_FRONT, GL_SPECULAR, mat_Specular);
	glMaterialf(GL_FRONT, GL_SHININESS, m_Shininess);
}
